# 判断一个字符序列是否未为英文单词, 需要依赖 dictionary.txt文件作为词库

UPPERLETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
LETTERS_AND_SPACE = UPPERLETTERS + UPPERLETTERS.lower() + " \t\n"

def loadDictionary():
    dictionaryFile = open("dictionary.txt")
    englishWords = set()
    for word in dictionaryFile:
        englishWords.add(word.strip())

    print(len(englishWords))
    print(englishWords.__contains__("window".upper()))


if __name__ == '__main__':
    loadDictionary()
